// components/page-container/page-container.js
Component({
  properties: {
    // 是否启用底部安全区域
    enableBottomSafe: {
      type: Boolean,
      value: true
    },
    // 自定义底部间距
    bottomPadding: {
      type: String,
      value: ''
    }
  },

  data: {
    bottomPadding: ''
  },

  lifetimes: {
    attached() {
      this.updateBottomPadding();
    }
  },

  methods: {
    updateBottomPadding() {
      const { enableBottomSafe, bottomPadding } = this.properties;
      
      if (bottomPadding) {
        this.setData({ bottomPadding });
      } else if (enableBottomSafe) {
        this.setData({ bottomPadding: 'var(--tab-bar-safe-height)' });
      } else {
        this.setData({ bottomPadding: '0' });
      }
    }
  }
});
